Forex
Retrieve Forex Currency
Welcome to the Omise Docs! These pages should contain everything you need to know to get paid using the Omise API. This is developer-oriented documentation.If you are not a developer, you can check our comprehensive support articles for non-technical explanations of various concepts or go straight to the plugin overview.
Retrieve Forex Currency
curl -X GET\
-H "Accept: application/json"\
"https://api.omise.co/forex/{currency}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ForexApi;
import java.io.File;
import java.util.*;
public class ForexApiExample {
public static void main(String[] args) {
ForexApi apiInstance = new ForexApi();
String currency = currency_example; // String |
try {
forex result = apiInstance.forexCurrencyGet(currency);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ForexApi#forexCurrencyGet");
e.printStackTrace();
}
}
}
import io.swagger.client.api.ForexApi;
public class ForexApiExample {
public static void main(String[] args) {
ForexApi apiInstance = new ForexApi();
String currency = currency_example; // String |
try {
forex result = apiInstance.forexCurrencyGet(currency);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ForexApi#forexCurrencyGet");
e.printStackTrace();
}
}
}
String *currency = currency_example; //
ForexApi *apiInstance = [[ForexApi alloc] init];
[apiInstance forexCurrencyGetWith:currency
completionHandler: ^(forex output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OmiseApi = require('omise_api');
var api = new OmiseApi.ForexApi()
var currency = currency_example; // {{String}}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.forexCurrencyGet(currency, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class forexCurrencyGetExample
{
public void main()
{
var apiInstance = new ForexApi();
var currency = currency_example; // String |
try
{
forex result = apiInstance.forexCurrencyGet(currency);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ForexApi.forexCurrencyGet: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiForexApi();
$currency = currency_example; // String |
try {
$result = $api_instance->forexCurrencyGet($currency);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ForexApi->forexCurrencyGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ForexApi;
my $api_instance = WWW::SwaggerClient::ForexApi->new();
my $currency = currency_example; # String |
eval {
my $result = $api_instance->forexCurrencyGet(currency => $currency);
print Dumper($result);
};
if ($@) {
warn "Exception when calling ForexApi->forexCurrencyGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.ForexApi()
currency = currency_example # String |
try:
api_response = api_instance.forex_currency_get(currency)
pprint(api_response)
except ApiException as e:
print("Exception when calling ForexApi->forexCurrencyGet: %s\n" % e)
Parameters
Name | Description |
---|---|
currency* | String Required |
Responses
Status: 200
{
"object": {
"pattern": "forex",
"type": "string",
"default": "forex"
},
"rate": {
"type": "number",
"format": "float"
},
"location": {
"type": "string"
},
"livemode": {
"type": "boolean",
"enum": [
true,
false
]
},
"base": {
"type": "string",
"format": "currency"
},
"quote": {
"type": "string",
"format": "currency"
}
}